package com.tod.security.springsecuritydbencrypt.filter;

import org.springframework.web.filter.GenericFilterBean;

import javax.servlet.FilterChain;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import java.io.IOException;

/**
 * Created with IntelliJ IDEA.
 * Description: 自定义过滤链
 * User: Tod.xie
 * Date: 2018-02-06
 * Time: 10:16
 *
 * @author Tod.xie
 */
public class BeforeLoginFilter extends GenericFilterBean {
    @Override
    public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
        System.out.println("This is a filter before UsernamePasswordAuthenticationFilter.");

        // 继续调用 Filter 链
        filterChain.doFilter(servletRequest, servletResponse);
    }
}
